import React, { Component } from 'react'
import UserTable from '../../Model/Table/UserTable'
interface Iprops{
    list:Array<UserTable>,
    del:(id?:number)=>void
}

export default class List extends Component <Iprops,any>{
    constructor(props:Iprops){
        super(props);
        this.state={}
    }
  render() {
    return (<>{this.props.list.map(item=>{
        return <div className='tr' key={item.id}>
        <div className='td'>{item.id}</div>
        <div className='td'>{item.name}</div>
        <div className='td'>{item.pwd}</div>
        <div className='td' onClick={()=>{this.props.del(item.id)}}>删除</div>
    </div>
    })}</>)
    
  }
}
